*Import CSV with "First row as variable names: Always"
*Variable Transformations
gen control = .
gen tag = .
gen supertag = .
gen notag = .
replace control = 1 if group == "control"
replace control = 0 if group != "control"
replace tag = 1 if group == "tag"
replace tag = 1 if group == "Tag"
replace tag = 0 if group != "Tag"
replace no = 0 if group != "NoTag"
replace no = 1 if group == "NoTag"
replace supertag = 1 if group == "supertag"
replace supertag = 0 if group != "supertag"
gen govfunded = .
replace govfunded = 1 if q51 == "Government Funded"
replace govfunded = 1 if q51 == "Government funded"
replace govfunded = 0 if q51 != "Government funded"
gen q421 = .
replace q421 = 1 if q42 == "Very accurate"
replace q421 = 2 if q42 == "Somewhat accurate" 
replace q421 = 3 if q42 == "Somewhat inaccurate" 
replace q421 = 4 if q42 == "Very inaccurate" 
gen noticedtag = .
replace noticedtag = 1 if strpos(q52, "A statement that RT was funded by the Russian Government") 
replace noticedtag = 0 if !strpos(q52, "A statement that RT was funded by the Russian Government")  
gen q471 = .
replace q471 = 1 if q47 == "A very significant effect"
replace q471 = 2 if q47 == "A significant effect"
replace q471 = 3 if q47 == "An insignificant effect"
replace q471 = 4 if q47 == "A very insignificant effect"
gen republican = .
replace republican = 1 if q54 == "Republican"
replace republican = 1 if q57 == "the Republican Party"
replace republican = 0 if republican != 1
gen spending = .
replace spending = 1 if q44 == "More than $100,000"
replace spending = 2 if q44 == "More than $10,000"
replace spending = 3 if q44 == "About $5,000"
replace spending = 4 if q44 == "Less than $1,000"
replace spending = 5 if q44 == "Less than $100"
gen sawvideo = .
replace sawvideo = 1 if notag == 1 
replace sawvideo = 1 if tag == 1 
replace sawvideo = 1 if supertag == 1 
replace sawvideo = 0 if control == 1
gen educ = .
replace educ = 1 if q6 == "None, or grade 1-8"
replace educ = 1 if q6 == "High school incomplete (grades 9-11)"
replace educ = 2 if q6 == "High school diploma or equivalent, no further schooling"
replace educ = 3 if q6 == "Technical or vocational school after high school"
replace educ = 4 if q6 == "Some college, no degree"
replace educ = 5 if q6 == "Associate's or two-year college degree"
replace educ = 6 if q6 == "Four-year college degree"
replace educ = 7 if q6 == "Graduate or professional school after college, no degree"
replace educ = 8 if q6 == "Graduate or professional degree"
gen q472 = .
replace q472 = 1 if q471 == 4
replace q472 = 2 if q471 == 3
replace q472 = 3 if q471 == 2
replace q472 = 4 if q471 == 1
gen q422 = .
replace q422 = 1 if q421 == 4
replace q422 = 2 if q421 == 3
replace q422 = 3 if q421 == 2
replace q422 = 4 if q421 == 1
*Trimming
drop if durationinseconds < 60
*Testing for randomization
reg control republican
reg notag republican
reg tag republican
reg super republican
reg control educ
reg notag educ
reg tag educ
reg super educ
*Summaries
summ govfunded if control == 1
summ govfunded if notag == 1
summ govfunded if tag == 1
summ govfunded if super == 1
summ noticedtag if control == 1
summ noticedtag if notag == 1
summ noticedtag if tag == 1
summ noticedtag if super == 1
summ q422 if control == 1
summ q422 if notag == 1
summ q422 if tag == 1
summ q422 if super == 1
summ q422 if control == 1 & republican == 0
summ q422 if notag == 1 & republican == 0
summ q422 if tag == 1 & republican == 0
summ q422 if super == 1 & republican == 0
summ q472 if control == 1 
summ q472 if notag == 1
summ q472 if tag == 1
summ q472 if super == 1
summ q472 if control == 1 & republican == 0
summ q472 if notag == 1 & republican == 0
summ q472 if tag == 1 & republican == 0
summ q472 if super == 1 & republican == 0
*Regressions
reg govfunded notag tag supertag
reg govfunded control tag supertag
reg govfunded control notag supertag
reg govfunded control notag tag
reg q422 notag tag supertag
reg q422 notag tag supertag if republican == 0
reg q422 notag tag supertag if republican == 1
reg q472 notag tag supertag
reg q472 notag tag supertag if republican == 0
reg q472 notag tag supertag if republican == 1
reg noticedtag notag tag supertag
reg spending notag tag supertag
reg q422 sawvideo
reg q422 sawvideo if republican == 0
reg q472 sawvideo if republican == 0
reg q472 sawvideo
reg spending sawvideo
reg spending sawvideo if republican == 0
